/*
 * 
 *
 * Authors: Soeren Gebbert, soeren.gebbert@vti.bund.de
 *          Axel Don, axel.don@vti.bund.de
 *
 * Copyright:
 *
 * Johann Heinrich von Thünen-Institut
 * Institut für Agrarrelevante Klimaforschung
 *
 * Phone: +49 (0)531 596 2601
 *
 * Fax:+49 (0)531 596 2699
 *
 * Mail: ak@vti.bund.de
 *
 * Bundesallee 50
 * 38116 Braunschweig
 * Germany
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef INITIAL_PARAMETERS_H
#define INITIAL_PARAMETERS_H

#include <iostream>
#include <fstream>
#include <vector>
#include <string>

class event_base;
/*
 * The Root of the coordinate system is the upper left corner
 *
 *  0 1 2 3 4 width (x-coordinates)
 * -1        
 * -2        
 * -3
 * -4
 *  depth (z-coordinates)
 */ 

/* Initial parameter */
class initial_parameters {
public:    
    unsigned int number_of_timesteps;
    unsigned int max_num_carb_particle;  /* Maximum number of initial carbon particles */
    unsigned int num_micr_cluster;       /* Number of initial micro-organism cluster */
    float width;                /* in [cm] */
    float height;                /* in [cm] */
    float depth;                /* in [cm] below NN */
    unsigned int depth_steps;            /* depth discretization steps */
    int max_carb_depth;         /* maximum initial depth in [cm] of carbon particle creation */ 
    int max_micr_depth;         /* maximum initial depth in [cm] of micro aroganism cluster creation */ 
    float min_initial_micr_mass;/* Minimum mass of initial micro organism */
    float max_initial_micr_mass;/* Maximum mass of initial micro organism */
    float porosity;             /* The porosity in 100% == 1.0 */
    unsigned int seed;          /* Seed for random number generator */
    unsigned int output_step;   /* The timestep output is generated */
    std::string micr_filename;       /* the filename of the micro-organism output */
    std::string carb_filename;       /* the filename of the carbon particle output */
    std::string profile_filename;    /* the filename of the depth profile */
    std::string run_filename;        /* the filename of the run information */
    std::string search_method;       /* The approxiamte nearest neighbour search method, "brute force" or ANN */
    std::vector <event_base*> events; /* This vector stores all registered events */
    bool constant_radius; /* If this is set to 1 a constant radius is used for nearest neighbour carbon search.
                          * The radius computation using the mass of the micro organism will be disabled. 
                          * Default is 0.
                          */
    /* 
     * We use the constructor to initiate default values
     */
    initial_parameters();
    /* Read the initial parameter file */
    void read(char *filename);
};
#endif